package com.zkzx.company.api.client.order;

import com.zkzx.common.freight.command.OrderCommand;
import com.zkzx.common.freight.model.OrderListVO;
import com.zkzx.common.freight.model.OrderVO;
import com.zkzx.common.freight.vo.OrderStatisticsVO;
import com.zkzx.common.vo.PageResult;
import com.zkzx.common.vo.StatusVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/12/19:46
 * @Description:
 */

@FeignClient(name = "ZKZX-FREIGHT-BILL")
//@FeignClient(name = "ZKZX-FREIGHT-BILL",url = "http://localhost:28083")
public interface OrderClient {

    @GetMapping("/ZKZX-FREIGHT-BILL/orders")
    @ApiOperation(value = "获取车辆列表", notes = "获取车辆列表")
    PageResult<OrderListVO> find(@ApiParam(value = "查询参数") @RequestParam("filterParam") String filterParamJson,
                                 @ApiParam(value = "分页查询参数")  @RequestParam("params") String paramsJson) ;


    @GetMapping("/ZKZX-FREIGHT-BILL/orders/{id}")
    OrderVO getById(@PathVariable("id") Integer id);


    @PutMapping("/ZKZX-FREIGHT-BILL/orders/{id}")
    void update(@PathVariable("id") Integer id,@RequestBody @Valid OrderCommand command,@RequestHeader("userId") Integer userId);


    @PostMapping("/ZKZX-FREIGHT-BILL/orders")
    StatusVO add(@RequestBody @Valid OrderCommand command, @RequestHeader("userId") Integer userId);

    @GetMapping("/ZKZX-FREIGHT-BILL/orders/statistics")
    OrderStatisticsVO getOrderStatistics(@RequestParam("company_id")Integer companyId);



    @PostMapping("/ZKZX-TRUCK/orders/{id}")
    void verification(@PathVariable("id") Integer id ) ;

    @PostMapping("/ZKZX-TRUCK/{id}/pay")
    void payment(@PathVariable("id") Integer id);

    @PostMapping("/ZKZX-TRUCK/{id}/invoice")
    void invoice(@PathVariable("id") Integer id);

}
